package com.mti.epivisitemobile.controller
{
	import com.mti.epivisite.common.event.EpivisiteEvent;
	import com.mti.epivisite.common.event.EventProxy;
	import com.mti.epivisite.common.map.MapProxyMock;
	import com.mti.epivisitemobile.Constants;
	import com.mti.epivisitemobile.model.EventListProxy;
	import com.mti.epivisitemobile.model.EventListProxyMock;
	import com.mti.epivisitemobile.model.HtmlProxy;
	import com.mti.epivisitemobile.view.ApplicationMediator;
	
	import flash.net.registerClassAlias;
	
	import org.puremvc.as3.interfaces.INotification;
	import org.puremvc.as3.patterns.command.SimpleCommand;
	
	public class StartupCommand extends SimpleCommand
	{
		public function StartupCommand()
		{
			super();
		}
		
		override public function execute(note:INotification):void
		{
			facade.registerCommand(Constants.MEDIATE_VIEW, MediateViewCommand);
			facade.registerCommand(Constants.LOAD_EVENT, LoadEventCommand);
			facade.registerCommand(Constants.LOAD_POI, LoadPoiCommand);
			
			facade.registerProxy(new EventProxy());
			facade.registerProxy(new EventListProxy());
			facade.registerProxy(new HtmlProxy());
			
			var app:EpiVisiteMobile = EpiVisiteMobile(note.getBody());
			facade.registerMediator(new ApplicationMediator(app));
			
			sendNotification(Constants.APP_READY);
		}
	}
}